package plus.xj17520.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @projectName: pethomeProject
 * @package: plus.xj17520.org.domain
 * @className: UserDomain
 * @author: XiaoJue
 * @description: TODO
 * @date: 2022/5/23 15:15
 * @version: 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_user")
@ApiModel(description = "用户实体类对象")
public class User extends BaseDomain{
    @Id
    @ApiModelProperty(value = "用户对象的主键")
    // 用户主键id
    private Long id;

    // 用户姓名
    @ApiModelProperty(value = "用户姓名")
    private String username;

    // 用户的email
    @ApiModelProperty(value = "用户的email")
    private String email;

    // 用户的手机号
    @ApiModelProperty(value = "用户的手机号")
    private String phone;

    // 用户的salt
    @ApiModelProperty(value = "用户的salt:盐值")
    private String salt;

    // 用户的密码
    @ApiModelProperty(value = "用户的密码")
    private String password;

    // 用户的状态：1正常，2禁用
    @ApiModelProperty(value = "员工的年龄:1正常，2禁用")
    private Integer state;

    // 用户的年龄
    @ApiModelProperty(value = "用户的年龄")
    private Integer age;

    // 用户的create_time
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "用户的create_time")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "用户的update_time")
    private Date updateTime = new Date();

    // 用户的head_img
    @ApiModelProperty(value = "用户的head_img")
    private String headImg;

    // 用户del:默认值是1,表示未删除,删除,0
    @ApiModelProperty(value = "用户del:默认值是1,表示未删除,删除,0")
    private Integer del;
}
